package cn.kow.kmall.common.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: lijun
 * @Description:
 * @Date: Created in 2019-08-12 9:35
 * @Modified By:
 */
public enum ItemStatusEnum {

    DEFAULT((short) 0, "待上架"),
    ONLINE((short) 1, "上架"),
    OFFLINE((short) 2, "下架"),
    ;

    private Short value;

    private String desc;

    public Short getValue() {
        return value;
    }

    public void setValue(Short value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    ItemStatusEnum(Short value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static Map<Short, String> getMap() {
        Map<Short, String> map = new HashMap<>();
        for (ItemStatusEnum entry : ItemStatusEnum.values()) {
            map.put(entry.getValue(), entry.getDesc());
        }
        return map;
    }
}
